/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package bean;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author mezouari
 */
@Entity
@Table(name = "visitetechnique")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Visitetechnique.findAll", query = "SELECT v FROM Visitetechnique v"),
    @NamedQuery(name = "Visitetechnique.findById", query = "SELECT v FROM Visitetechnique v WHERE v.id = :id"),
    @NamedQuery(name = "Visitetechnique.findByNumero", query = "SELECT v FROM Visitetechnique v WHERE v.numero = :numero"),
    @NamedQuery(name = "Visitetechnique.findByDate", query = "SELECT v FROM Visitetechnique v WHERE v.date = :date"),
    @NamedQuery(name = "Visitetechnique.findByMontant", query = "SELECT v FROM Visitetechnique v WHERE v.montant = :montant")})
public class Visitetechnique implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "Id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "Numero")
    private int numero;
    @Basic(optional = false)
    @Column(name = "Date")
    @Temporal(TemporalType.DATE)
    private Date date;
    @Basic(optional = false)
    @Column(name = "Montant")
    private double montant;
    @JoinColumn(name = "IdVehicule", referencedColumnName = "Id")
    @ManyToOne(optional = false)
    private Vehicule idVehicule;

    public Visitetechnique() {
    }

    public Visitetechnique(Integer id) {
        this.id = id;
    }

    public Visitetechnique(Integer id, int numero, Date date, double montant) {
        this.id = id;
        this.numero = numero;
        this.date = date;
        this.montant = montant;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getNumero() {
        return numero;
    }

    public void setNumero(int numero) {
        this.numero = numero;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public double getMontant() {
        return montant;
    }

    public void setMontant(double montant) {
        this.montant = montant;
    }

    public Vehicule getIdVehicule() {
        return idVehicule;
    }

    public void setIdVehicule(Vehicule idVehicule) {
        this.idVehicule = idVehicule;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Visitetechnique)) {
            return false;
        }
        Visitetechnique other = (Visitetechnique) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bean.Visitetechnique[ id=" + id + " ]";
    }
    
}
